﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Layout.Master" AutoEventWireup="true" CodeBehind="Banco_Preguntas.aspx.cs" Inherits="Sistema_Test_OnLine.Presentacion.Banco_Preguntas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
 <div id="content">
    <div id="contentmid">
        <div class="midheading">
          <h2>Banco de Preguntas</h2>
        </div>
        <div class="midtxt">
        <span class="midboldtxt">
            <br />
            Filtrar Lista de Resultados<br />
            </span>
            <asp:TextBox ID="txt_buscar_preguntas" runat="server" Width="283px"></asp:TextBox>
            <br />
            <br />
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Filtar" 
                Width="88px" />
            <br />
            <br />
		    <br />
		<div style="height: 547px">
        <div>
            <span class="midboldtxt"><a href="/Presentacion/Add_Pregunta.aspx" >&nbsp;</a><asp:GridView 
                ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" 
                BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" 
                CellPadding="3" CellSpacing="2" DataSourceID="ObjectDataSource1" 
                Width="496px" DataKeyNames="Codigo" 
                onselectedindexchanged="GridView1_SelectedIndexChanged1">
                <Columns>
                    <asp:BoundField DataField="Codigo" HeaderText="Codigo" 
                        SortExpression="Codigo" />
                    <asp:BoundField DataField="Enunciado" HeaderText="Enunciado" 
                        SortExpression="Enunciado" />
                    <asp:BoundField DataField="Tipo" HeaderText="Tipo de Pregunta" 
                        SortExpression="Tipo" />
                    <asp:BoundField DataField="Examen" HeaderText="Examen" 
                        SortExpression="Examen" />

                  

                    <asp:CommandField ShowSelectButton="True" ButtonType="Button" 
                        HeaderText="Editar" SelectText="Editar" />
                   


                    <asp:TemplateField HeaderText="Eliminar">
                    <ItemTemplate>
                        <asp:Button ID="Button1" runat="server" CausesValidation="False" 
                            CommandName="Delete" Text="Eliminar" OnClientClick ='return confirm("¿Esta seguro que sesea eliminar el producto?")' />
                    </ItemTemplate>
                    </asp:TemplateField>



                </Columns>
                <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#FFF1D4" />
                <SortedAscendingHeaderStyle BackColor="#B95C30" />
                <SortedDescendingCellStyle BackColor="#F1E5CE" />
                <SortedDescendingHeaderStyle BackColor="#93451F" />
            </asp:GridView>
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                DeleteMethod="RemovePregunta" SelectMethod="GetPregunta" 
                TypeName="Sistema_Test_OnLine.Logic.Facade" UpdateMethod="UpdatePregunta">
                <DeleteParameters>
                    <asp:Parameter Name="codigo" Type="Int32" />
                </DeleteParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="txt_buscar_preguntas" Name="criterio" 
                        PropertyName="Text" Type="String" />
                </SelectParameters>
                
                <UpdateParameters>
                    <asp:Parameter Name="codigo" Type="Int32" />

                </UpdateParameters>
                
            </asp:ObjectDataSource>
            <br />
            <a href="/Presentacion/Add_Pregunta.aspx" >Agregar Nueva Pregunta<br /></a>
        
            </span>
        
        </div>
		    <br />
		    <br />
		</div>
		</div>
    </div>
</div> 
    
</asp:Content>
